package validator;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

public class e {

    public static void showMsgSuccess(String detail) {
        showMsg("Success", detail, FacesMessage.SEVERITY_INFO);
    }

    public static void showMsgError(String detail) {
        showMsg(detail, detail, FacesMessage.SEVERITY_ERROR);
    }

    private static void showMsg(String summary, String detail, FacesMessage.Severity severity) {
        FacesMessage facesMessage = new FacesMessage(severity, summary, detail);
        FacesContext.getCurrentInstance().addMessage(null, facesMessage);
    }
}
